<!DOCTYPE html>
<html>
<head><meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>购买记录</title>
<link rel="stylesheet" href="../assets/mobile/top.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<link href="../assets/mobile/comm.css" rel="stylesheet" type="text/css" />
<link href="../assets/mobile/goods.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
<link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
<script type="text/javascript" src="../script/api.js"></script>
<script src="../assets/js/mobile/jquery190.js" type="text/javascript"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
</head>
<body style="background:#fff !important;position:static;">
<div id="ios-top-box">
    <div id="header" class="bar bar-nav">
    <div class="titlebar">
    <a href="javascript:appClose('obuyrecord',api);"><i class="iconfont iconline-arrow-left"></i></a>
    <h1 class="title">购买记录</h1>
    </div>
    </div>
</div>

    <!-- 抢购记录 -->

    <section id="buyRecordPage" class="goodsCon">
        <div id="divRecordList" class="recordCon z-minheight" style="display:block;">
        </div>
    </section>


<div class="clear"></div>

<script type="text/javascript" src="../assets/js/mobile/BottomFun.js"></script>
<script type="text/javascript">
var Base={head:document.getElementsByTagName("head")[0]||document.documentElement,Myload:function(B,A){this.done=false;B.onload=B.onreadystatechange=function(){if(!this.done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){this.done=true;A();B.onload=B.onreadystatechange=null;if(this.head&&B.parentNode){this.head.removeChild(B);}}};},getScript:function(A,C){var B=function(){};if(C!=undefined){B=C;}var D=document.createElement("script");D.setAttribute("language","javascript");D.setAttribute("type","text/javascript");D.setAttribute("src",A);this.head.appendChild(D);this.Myload(D,B);},getStyle:function(A,B){var B=function(){};if(callBack!=undefined){B=callBack;};var C=document.createElement("link");C.setAttribute("type","text/css");C.setAttribute("rel","stylesheet");C.setAttribute("href",A);this.head.appendChild(C);this.Myload(C,B);}};function GetVerNum(){var D=new Date();return D.getFullYear().toString().substring(2,4)+'.'+(D.getMonth()+1)+'.'+D.getDate()+'.'+D.getHours()+'.'+(D.getMinutes()<10?'0':D.getMinutes().toString().substring(0,1));}
apiready = function(){
    $(function() {
    var l = $("#hidCodeID").val();
    var e = $("#hidIsEnd").val() == "1";
    var f = $("#divBuyLoading");
    var d = $("#divRecordList");
    var j = $("#btnLoadMore");
    var c = null;
    var h = 10;
    var a = 0;
    var b = e ? "GetUserBuyListByCodeEnd": "GetUserBuyListByCode";
    var i = {
        codeID: l,
        FIdx: 1,
        EIdx: h,
        isCount: 1,
        sort: 0
    };
    var g = function() {
        var m = function() {
            return "codeID=" + i.codeID + "&FIdx=" + i.FIdx + "&EIdx=" + i.EIdx + "&isCount=" + i.isCount + "&sort=" + i.sort;
        };
        var n = function() {
            f.show();
            var itemid = localData.get('dataserver_goods_id');
            if(!itemid){
                api.alert({title:'提示',msg:'数据不存在'},function(index,err){
                    appClose('obuyrecord',api);
                });
                
                return;
            }
            GetJPData(config.url+"/app.php?act=buyrecordsajax&goods_id="+itemid,{sort:i.sort},function(r) {
                //Gobal.NoneHtml
                if(r['status'] == 1){
                    var s = '';
                    for(var i in r['data']){
                        s += '<ul><li class="rBg"><a href="javascript:openItem(\'userindex\','+r['data'][i].uid+',function(id){localData.set(\'userid\',id);});"><img class="lazy" data-original="'+config.upload_url+'/'+r['data'][i]['uphoto']+'"><s></s></a></li><li class="rInfo"><a href="javascript:openItem(\'userindex\','+r['data'][i].uid+',function(id){localData.set(\'userid\',id);});">' + r['data'][i].username + "</a><strong>(IP:"+r['data'][i].ip1+r['data'][i].ip2+')</strong><br><span>'+r['data'][i]['web_name_two']+'了<b class="orange">' + r['data'][i].gonumber + '</b>人次</span><em class="arial">' + r['data'][i].time + "</em></li><i></i></ul>"; 
                    }
                    $('#divRecordList').html(s);
                    lyzimg();
                }else{
                    $('#buyRecordPage').html(Gobal.NoneHtml);
                }
            });
        };
        this.initData = function() {
            i.FIdx = 1;
            i.EIdx = h;
            i.isCount = 1;
            n();
        };
        this.getNextPage = function() {
            i.FIdx = i.FIdx + h;
            i.EIdx = i.EIdx + h;
            n();
        };
    };
    
    c = new g();
    c.initData();
    var e = false;
    var k = false;
    j.click(function() {
        if (!k) {
            k = true;
            j.hide();
            c.getNextPage();
        }
    });
    
    $("#btnSort").click(function() {
        if (!k) {
            e = false;
            if (i.sort == 0) {
                $(this).html('<i></i>排序<s class="z-Sswt"></s><s class="z-Sswd"></s>');
                i.sort = 1;
            } else {
                $(this).html('<i></i>排序<s class="z-SswOn"></s><s class="z-SswNt"></s>');
                i.sort = 0;
            }
            d.empty();
            c.initData();
        }
    });
    g();
});
};
</script>
</body>
</html>